<extend name="Public/base" />
<block name="content">
<script src="__JS__/jjhh.js?v={:C('TKE_VERSION')}"></script>
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a class="tip-bottom" href="{:U('Index/index')}" data-original-title="首页"><i class="icon-home"></i> 首页</a>
			<a class="tip-bottom" href="{:U('Base/salePoint')}" data-original-title="">{$meta_title_c}</a>
			<a class="current" href="{$post_url}">{$meta_title}</a>
		</div>
	</div>
	<div class="container-fluid">
		<br/>
		
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-align-justify"></i></span>
						<h5>{$meta_title}</h5>
					</div>
					<div class="widget-content nopadding">
						<form class="form-horizontal" method="post" action="">
							
							
							<div class="span12 control-group">
								<notempty name='list'>
									<label class="control-label" style="width:180px; margin-right:20px;">区域选择</label>
								<else/>
									<label class="control-label" style="width:180px; margin-right:20px;"><font color="red">*</font>区域选择</label>
								</notempty>
								<!-- 区域联动 -->
								<div class="control-group" style="margin-top:10px; line-height:37px;">
									<notempty name='list'>
									<span class="control-group pull-left">
										<select data-default="{$list.province_id}" required="required" name="province_id" style="width:150px;" class="select-group" readonly="readonly" disabled="disabled" id="j-select-province">
											<option value="{$list.province_id}">{$list.province_id|getProvinceName}</option>
										</select>
									</span>
									<else/>
									<span class="control-group pull-left">
										<select data-default="1" required="required" name="province_id" style="width:150px;" class="select-group" disabled="true" id="j-select-province">
											<option value="0">请选择省</option>
										</select>
									</span>
									</notempty>
									
									<notempty name='list'>
									<span class="control-group pull-left">
										<select data-default="{$list.city_id}" required="required" name="city_id" style="width:150px;" class="select-group" disabled="disabled" readonly="readonly"  id="j-select-city">
											<option value="{$list.city_id}">{$list.city_id|getCityName}</option>
										</select>
									</span>
									<else/>
									<span class="control-group pull-left">
										<select disabled="true" data-default="1" required="required" name="city_id" style="width:150px;" class="select-group" id="j-select-city">
											<option value="0">请选择城市</option>
										</select>
									</span>
									</notempty>
									<notempty name='list'>
									<span class="control-group pull-left">
										<select data-default="{$list.ward_id}" required="required" name="ward_id" style="width:150px;" class="select-group" disabled="disabled" readonly="readonly"  id="j-select-ward">
											<option value="{$list.ward_id}">{$list.ward_id|getWardName}</option>
										</select>
									</span>
									<else/>
									<span class="control-group pull-left">
										<select disabled="true" data-default="0" required="required" name="ward_id" style="width:150px;" class="select-group" id="j-select-ward">
											<option value="0">请选择区</option>
										</select>
									</span>
									</notempty>
								</div>
								<!-- /区域联动 -->
							</div>
							
							
							<div class="control-group" style="line-height:48px;">
								<notempty name='list'>
									<label class="control-label" style="width:180px; margin-right:20px;">销售网点名称</label>
								<else/>
									<label class="control-label" style="width:180px; margin-right:20px;"><font color="red">*</font>销售网店名称</label>
								</notempty>
								<div class="control-group" >
									<input type="text" maxlength="30" placeholder="销售网点名称1-30个字符" class="ui-wizard-content span3" name="sale_point_name" value="{$list.sale_point_name|htmlspecialchars}" >
								</div>
							</div>
							
							<div class="form-actions">
								<button class="btn btn-success" type="submit">提交</button>
								<button type="button" class="btn btn-danger" onclick="javascript:history.back(-1);return false;">返 回</button>
							</div>
							<input type="hidden" name="sale_point_id" value="{$list.sale_point_id}"/>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
	//省市区联动
var url_area = {
		"province" :"{:U('ServiceApi/getProvinceList', array('v'=> C('TKE_VERSION')))}",
"city" :"{:U('ServiceApi/getProvinceCityList', array('v'=> C('TKE_VERSION')))}",
"ward": "{:U('ServiceApi/getCityWard', array('v'=> C('TKE_VERSION')))}",
"village": "{:U('ServiceApi/getWardVillage', array('v'=> C('TKE_VERSION')))}"
}
// 初始化select
jjhh_select_area(url_area, 3);
	
	//初始化登录用户名输入焦点
	tke_form_focus();
	$("form").submit(function(){
		//锁定登录按钮
		$('button').attr('disabled',true);
		var self = $(this);
		$.post("{$post_url}", self.serialize(), call_back, "json");
		return false;
		
		/**
		* @todo 接收登录返回值
		* @author PHP@妖孽 <dino_ma@163.com>
		*/
		function call_back(data){
			if(data.status==1){
				tke_alert(data.info,'alert-success');
				setTimeout(function(){
				if (data.url) {
						location.href=data.url;
					}else{
						location.reload();
					}
				},1500);
			} else {
				$('button').attr('disabled',false);
				tke_alert(data.info,'alert-error');
			}
		}
	});
	//导航高亮
	highlight_subnav("{:U('Base/salePoint')}");
});
</script>
</block>